export function download(url, params, filename) {
  request(url, METHOD.POST, params, {
      headers: {
          'Content-Type': 'application/json;charset=UTF-8'
      },
      responseType: 'blob'
  })
      .then(data => {
          const content = data.data
          const blob = new Blob([content])
          if ('download' in document.createElement('a')) {
              const elink = document.createElement('a')
              elink.download = filename
              elink.style.display = 'none'
              elink.href = URL.createObjectURL(blob)
              document.body.appendChild(elink)
              elink.click()
              URL.revokeObjectURL(elink.href)
              document.body.removeChild(elink)
          } else {
              navigator.msSaveBlob(blob, filename)
          }
      })
      .catch(r => {
          console.error(r)
          store.commit('setting/setLoading', false)
      })
}

// download(`${BASE_URL}/fill/export`, { ...queryParams },'文件名字.xlsx')